﻿@{
    Layout = null;
    DeliveryManage.Models.ReturnMsgModel returnMsg = ViewBag.ReturnMsgModel;
}
@model DeliveryManage.Model.Pro_Orders
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <link rel="stylesheet" href="~/Content/font.css">
    <link rel="stylesheet" href="~/Content/framemain.css">
    <link rel="stylesheet" href="~/Content/pagination.css" />
    <script type="text/javascript" src="~/Content/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="~/Scripts/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="~/Scripts/common.js"></script>
    <script type="text/javascript" src="~/Scripts/framemain.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
    <style>
        .layui-table img {
            max-width: inherit;
        }

        .pro-img {
            border-radius: 5px;
            border: 1px solid #f2f2f2;
        }
        .layui-radio-disbaled > i {
            color: #5FB878 !important;
        }
        .layui-disabled {
            color:#222 !important;
        }
    </style>
</head>
<body>
    <form id="myfrom" class="tab-content layui-form" action="" lay-filter="example">
        @{
            if (returnMsg.code == 200)
            {
                <div class="layui-fluid">
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-card">
                                        <div class="layui-card-body ">
                                            <blockquote class="layui-elem-quote">客户基础信息</blockquote>
                                            <table class="layui-table layui-form">
                                                <thead>
                                                    <tr>
                                                        <th>客户姓名</th>
                                                        <th>客户电话</th>
                                                        <th>客户性别</th>
                                                        <th>客户地址</th>
                                                    </tr>
                                                </thead>
                                                <tbody id="GoodsInfo">
                                                    <tr>
                                                        <td>@Model.CustomerName</td>
                                                        <td>@Model.CustomerTel</td>
                                                        <td>@(Model.CustomerSex?"男":"女")</td>
                                                        <td>@Model.CustomerAddress</td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                            <blockquote class="layui-elem-quote">
                                                所选套餐信息
                                            </blockquote>
                                            <table class="layui-table layui-form">
                                                <thead>
                                                    <tr>
                                                        <th>套餐名称</th>
                                                        <th>购买数量</th>
                                                        <th>套餐类型</th>
                                                        <th>箱数</th>
                                                        <th>瓶数</th>
                                                        <th>套餐单价</th>
                                                        <th>套餐总价</th>
                                                        <th>商品加价</th>
                                                        <th>快递费</th>
                                                        <th>预收货款</th>
                                                        <th>代收货款</th>
                                                        <th>实际总金额</th>
                                                    </tr>
                                                </thead>
                                                <tbody id="GoodsInfo">
                                                    @if (Model.OrderGoods != null && Model.OrderGoods.Count > 0)
                                                    {
                                                        int BuyNum = 0;
                                                        int CalcSpec = 0;
                                                        int SpecNum = 0;
                                                        decimal GoodsAmount = 0.00M;
                                                        decimal AddPrice = 0.00M;
                                                        decimal Freight = 0.00M;
                                                        decimal AdvanceCharge = 0.00M;
                                                        decimal InvoicingCharge = 0.00M;
                                                        foreach (DeliveryManage.Model.Pro_OrderGoods item in Model.OrderGoods)
                                                        {
                                                            BuyNum += item.BuyNum;
                                                            CalcSpec += item.CalcSpec;
                                                            SpecNum += item.SpecNum;
                                                            GoodsAmount += item.GoodsAmount;
                                                            AddPrice += item.AddPrice;
                                                            Freight += item.Freight;
                                                            AdvanceCharge += item.AdvanceCharge;
                                                            InvoicingCharge += item.InvoicingCharge;
                                                            <tr>
                                                                <td>@item.GoodsName</td>
                                                                <td>@item.BuyNum</td>
                                                                <td>
                                                                    @{
                                                                        if (item.IsActivity)
                                                                        {
                                                                            <button type="button" class="layui-btn layui-bg-orange layui-btn-radius">活动套餐</button>
                                                                        }
                                                                        else
                                                                        {
                                                                            <button type="button" class="layui-btn layui-bg-blue layui-btn-radius">普通套餐</button>
                                                                        }
                                                                    }
                                                                </td>
                                                                <td>@item.CalcSpec</td>
                                                                <td>@item.SpecNum</td>
                                                                <td>@item.Price</td>
                                                                <td>@(item.GoodsAmount) ￥</td>
                                                                <td>@item.AddPrice ￥</td>
                                                                <td>@item.Freight ￥</td>
                                                                <td>@item.AdvanceCharge ￥</td>
                                                                <td>@item.InvoicingCharge ￥</td>
                                                                <td>@item.TotalAmount ￥</td>
                                                            </tr>
                                                        }
                                                        <tr style="color:red">
                                                            <td>合计</td>
                                                            <td>@BuyNum</td>
                                                            <td></td>
                                                            <td>@CalcSpec</td>
                                                            <td>@SpecNum</td>
                                                            <td></td>
                                                            <td>@GoodsAmount ￥</td>
                                                            <td>@AddPrice ￥</td>
                                                            <td>@Freight ￥</td>
                                                            <td>@AdvanceCharge ￥</td>
                                                            <td>@InvoicingCharge ￥</td>
                                                            <td>@Model.TotalAmount ￥</td>
                                                        </tr>
                                                    }
                                                    else
                                                    {
                                                        <tr>
                                                            <td colspan="12" align="center" height="120"><img src="~/images/nodata.png" style="height:80px;" /><br />未添加任何套餐</td>
                                                        </tr>
                                                    }
                                                </tbody>
                                            </table>
                                            <blockquote class="layui-elem-quote">订单信息</blockquote>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">订单类型</label>
                                                <div class="layui-input-block">
                                                    <input type="radio" name="OrderType" value="false" title="新订单" @(Model.OrderType == false ? "checked=\"checked\"" : "") disabled="disabled">
                                                    <input type="radio" name="OrderType" value="true" title="复购订单" @(Model.OrderType == true ? "checked=\"checked\"" : "") disabled="disabled">
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">发货方式</label>
                                                <div class="layui-input-block">
                                                    @Html.DropDownListFor(m => m.DeliveryWay, ViewData["DeliveryWayList"] as SelectList, new { @class = "layui-input layui-select", id = "DeliveryWay", @lay_filter = "DeliveryWay", @disabled = "disabled" })
                                                </div>
                                            </div>
                                            <div class="layui-form-item layui-form-text">
                                                <label class="layui-form-label">订单备注</label>
                                                <div class="layui-input-block">
                                                    @Html.TextAreaFor(m => m.Remark, new { @class = "layui-textarea", @sucmsg = " ", placeholder = "备注内容", @readonly = "readonly" })
                                                </div>
                                            </div>
                                        </div>
                            </div>
                        </div>
                    </div>
                </div>
            }
        }
    </form>
    <script type="text/javascript">
        layui.use(['laydate', 'form'], function () {
            var laydate = layui.laydate;
            var form = layui.form;
        });
    </script>
</body>
</html>
